#include<iostream>

using namespace std;

int main(){
    int n, x, y;
    cin >> n >> x >> y;
    int sum = 0;
    for(int i = 0; i < n; i ++){
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        if(x1 >= 0 && x1 <= x){
            x1 = x1;
        }
        else if(x1 < 0){
            x1 = 0;
        }
        else{
            sum += 0;
            continue;
        }
        if(x2 >= 0 && x2 <= x){
            x2 = x2;
        }
        else if(x2 < 0){
            sum += 0;
            continue;
        }
        else{
            x2 = x;
        }
        if(y1 >= 0 && y1 <= y){
            y1 = y1;
        }
        else if(y1 < 0){
            y1 = 0;
        }
        else{
            sum += 0;
            continue;
        }
        if(y2 >= 0 && y2 <= y){
            y2 = y2;
        }
        else if(y2 < 0){
            sum += 0;
            continue;
        }
        else{
            y2 = y;
        }
        sum += (y2 - y1) * (x2 - x1);
    }
    cout << sum << endl;
}